package com.ysd.modules.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ysd.modules.app.dao.CoursesDao;
import com.ysd.modules.app.entity.CourseEntity;
import com.ysd.modules.app.service.CoursesService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CoursesServiceImpl extends ServiceImpl<CoursesDao, CourseEntity> implements CoursesService {

    @Override
    public List<CourseEntity> getAllCourses() {
        return baseMapper.selectList(new QueryWrapper<CourseEntity>().eq("status", 0));
    }

    @Override
    public CourseEntity getCourseById(int cid) {

        return baseMapper.selectById(cid);
    }

	@Override
	public List<CourseEntity> getCourseByStudentId(Integer stuId) {
		
		return baseMapper.getCourseByStudentId(stuId);
	}
}
